﻿var Login = function () {
    var loginName = $("#topTxtLoginName").val().trim();
    var loginPwd = $("#topTxtLoginPwd").val();
    var isRemember = $("#topCheRemember:checked").val() ? true : false;
    if (loginName.length > 0 && loginPwd.length >= 6) {
        loginPwd = hex_md5(loginPwd);
        $.ajax({
            type: 'POST',
            url: "/Action/Login.ashx",
            data: { loginName: loginName, loginPwd: loginPwd, isRemember: isRemember },
            async: true,
            success: function (responseData) {
                if (responseData == 1) {
                    window.location = "index.aspx";
                }
                if (responseData == 0) {
                    window.location = "Login.aspx?type=0&loginName=" + loginName;
                }
            },
            error: function (XMLHttpRequest, textStatus, errorThrown) {//请求失败处理函数
                alert("请求失败，无法获取分组数据");
            }
        })
    }
};